package com.hunanwenli.service.login;

import com.hunanwenli.entity.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

/**
 * @author wanzhenyu
 * @date 2021/6/3 0:02
 */
@Component
@FeignClient(value = "004-PROVIDER-LOGIN")
public interface FeignLoginService {

    @GetMapping(value = "/login/selectUserId/{phone}")
    Integer selectUserId(@PathVariable("phone") String phone);

    @GetMapping(value = "/login/isTruePwd/{id}/{password}")
    boolean isTruePwd(@PathVariable("id") Integer id, @PathVariable("password") String password);

    @GetMapping(value = "/login/getRedisUserInfo/{uuid}")
    UserInfo getRedisUserInfo(@PathVariable("uuid") String uuid);


    @PostMapping(value = "/register/fillPwd/{email}/{name}/{phone}/{pwd}")
    boolean fillPwd(@PathVariable("email") String email,
                    @PathVariable("name") String name,
                    @PathVariable("phone") String phone,
                    @PathVariable("pwd") String pwd);

    @GetMapping(value = "/register/ajaxEmail/{email}")
    String ajaxEmail(@PathVariable("email") String email);


    @GetMapping(value = "/register/ajaxYanZhenMa/{code}/{email}")
    String ajaxYanZhenMa(@PathVariable("code") String code,
                         @PathVariable("email") String email);


    @GetMapping(value = "/register/ajaxYanZhenMa2/{code}/{codeval}")
    String ajaxYanZhenMa2(@PathVariable("code") String code,
                          @PathVariable("codeval") String codeval);

    @GetMapping(value = "/register/ajaxPhone/{phone}")
    String ajaxPhone(@PathVariable("phone") String phone);

    @PutMapping(value = "/findPwd/findPwd4/{phone}/{password}")
    Integer findPwd4(@PathVariable("phone") String phone,
                     @PathVariable("password") String password);

    @GetMapping(value = "/findPwd/ajaxFindPwd/{phone}/{email}")
    String ajaxFindPwd(@PathVariable("phone") String phone,
                        @PathVariable("email") String email);

    @GetMapping(value = "/login/getUserInfoById/{uid}")
    @ResponseBody
    UserInfo getUserInfoById(@PathVariable("uid") Integer uid);
}


